-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement AliasOrigin processing in XCVM #7245
Conversation
This will still require rerunning the benchmarks and generating the weight files. |
bot clean |
bot bench $ xcm kusama pallet_xcm_benchmarks::generic |
bot clean |
bot merge |
bot clean |
bot merge |
Error: "Check reviews" status is not passing for paritytech/cumulus#2680 |
bot merge |
@@ -914,7 +914,15 @@ impl<Config: config::Config> XcmExecutor<Config> { | |||
self.context.topic = None; | |||
Ok(()) | |||
}, | |||
AliasOrigin(_) => Err(XcmError::NoPermission), | |||
AliasOrigin(target) => { | |||
let origin = self.origin_ref().ok_or(XcmError::BadOrigin)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont see any usage of AliasOrigin
now, and cannot find any restrictions or recommendation for this instruction,
but if we have ClearOrigin
before AliasOrigin
in XCM message, then it wont work, I dont know maybe it is intended,
just thinking, what if we change:
let origin = self.origin_ref().ok_or(XcmError::BadOrigin)?;
if Config::Aliasers::contains(origin, &target) {
to:
let effective_origin = self.context.origin.as_ref().unwrap_or(&self.original_origin);
if Config::Aliasers::contains(effective_origin, &target) {
would that be a problem or issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about that as well, but instead of using the original origin (could very easily lead to an origin escalation attack), we could also just have Aliasers::contains
accept an Option<MultiLocation>
as the origin ML. This will then allow custom logic to be used when the origin register is set to None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question with this approach now is to really ask ourselves whether AliasOrigin
is a privileged operation or not. To be safe, I've erred on the side of caution and made it so, but it does not necessarily have to be the case if we document it properly, letting other chains know that they absolutely need to know how to handle the None
case appropriately in their Aliasers
implementation.
Fixes #6668.
Processes the
AliasOrigin
instruction to allow for a given origin in the list ofAliasers
to be substituted by a given targetMultiLocation
.cumulus companion: paritytech/cumulus#2680